25. CODE: Use the ParseLine Function

Use the ParseLine Function

Great! With the ParseLine function complete, you can now use it in the ReadBoardFile to process each line of the incoming file. In this exercise, you will do just that: follow the TODOs in the code below, updating both ReadBoardFile and the main function to finish the processing of an external board file.

To Complete This Exercise:

  1. Update ReadBoardFile to use ParseLine and return the board as a vector<vector<int>>. You can read the TODO comments in the code for step by step instructions.
  2. Update the main function to pass the results of ReadBoardFile to the PrintBoard function.

Workspace

This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity, so you may be able to download them there.

Workspace Information:

  • Default file path:
  • Workspace type: generic
  • Opened files (when workspace is loaded): n/a
  • userCode:

    export CXX=g++-7
    export CXXFLAGS=-std=c++17
    g++() {
    /usr/bin/g++-7 -std=c++17 "$1"
    }
    export -f g++